class Student {
    constructor(name, chinese, math, english) {
        this.name = name;
        this.chinese = chinese;
        this.english = english;
        this.math = math;
    }
    fun() {
        let avg = (this.chinese + this.english + this.math) / 3;
        let max = Math.max(this.chinese, this.english, this.math);
        let min = Math.min(this.chinese, this.english, this.math);
        console.log(`${this.name}的平均分是${avg.toFixed(2)}，最高分是${max}，最低分是${min}`);
    }
}
class StuClass {
    constructor(students) {
        this.students = students;
    }
    fun1() {
        let chineseMax = 0;
        let chineseMin = Infinity;
        let chineseSum = 0;
        this.students.forEach((item) => {
            if (chineseMax < item.chinese) {
                chineseMax = item.chinese;
            }
            if (chineseMin > item.chinese) {
                chineseMin = item.chinese;
            }
            chineseSum += item.chinese;
        });
        let chineseAvg = chineseSum / this.students.length;
        console.log(`本班语文成绩最高分是${chineseMax}， 最低分是${chineseMin}, 平均分是${chineseAvg.toFixed(2)}`);
    }
}
let stu = new Student("张三", 80, 90, 95);
stu.fun();
let stu1 = new Student("李四", 67, 75, 68);
stu1.fun();
let cls1 = new StuClass([stu, stu1]);
cls1.fun1();
export {};
